home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cocktail / reuse.lha / reuse / m2c / Checks.c < prev    next >
C/C++ Source or Header  |  1992-08-18  |  947b  |  55 lines

  1. #include "SYSTEM_.h"
  2.  
  3. #ifndef DEFINITION_IO
  4. #include "IO.h"
  5. #endif
  6.  
  7. #ifndef DEFINITION_System
  8. #include "System.h"
  9. #endif
  10.  
  11. #ifndef DEFINITION_Checks
  12. #include "Checks.h"
  13. #endif
  14.  
  15.  
  16.  
  17.  
  18. void Checks_ErrorCheck
  19. # ifdef __STDC__
  20. (CHAR s[], LONGCARD O_1, INTEGER n)
  21. # else
  22. (s, O_1, n)
  23. CHAR s[];
  24. LONGCARD O_1;
  25. INTEGER n;
  26. # endif
  27. {
  28.   OPEN_ARRAY_LOCALS
  29.  
  30.   ALLOC_OPEN_ARRAYS(O_1 * sizeof(CHAR), 1)
  31.   COPY_OPEN_ARRAY(s, O_1, CHAR)
  32.   if (n < 0) {
  33.     IO_WriteS((System_tFile)IO_StdError, s, O_1);
  34.     IO_WriteS((System_tFile)IO_StdError, (STRING)" : ", 3L);
  35.     IO_WriteI((System_tFile)IO_StdError, n, 2L);
  36.     IO_WriteS((System_tFile)IO_StdError, (STRING)", errno    = ", 10L);
  37.     IO_WriteI((System_tFile)IO_StdError, ErrNum(), 2L);
  38.     IO_WriteNl((System_tFile)IO_StdError);
  39.   }
  40.   FREE_OPEN_ARRAYS
  41. }
  42.  
  43. void BEGIN_Checks()
  44. {
  45.   static BOOLEAN has_been_called = FALSE;
  46.  
  47.   if (!has_been_called) {
  48.     has_been_called = TRUE;
  49.  
  50.     BEGIN_IO();
  51.     BEGIN_System();
  52.  
  53.   }
  54. }
  55.